package moc.egg;
import moc.compiler.*;
import moc.tds.*;
import moc.type.*;
import moc.gc.*;
import java.util.*;
import moc.type.object.*;
import mg.egg.eggc.runtime.libjava.lex.*;
import mg.egg.eggc.runtime.libjava.*;
import mg.egg.eggc.runtime.libjava.messages.*;
import mg.egg.eggc.runtime.libjava.problem.IProblem;
import java.util.Vector;
public class S_IMPLEMENTATION_MOC {
LEX_MOC scanner;
  S_IMPLEMENTATION_MOC() {
    }
  S_IMPLEMENTATION_MOC(LEX_MOC scanner, boolean eval) {
    this.scanner = scanner;
    this.att_eval = eval;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_desc_code;
  int att_cpt_desc;
  boolean att_eval;
  String att_code;
  IMachine att_machine;
  int att_scpt_meth;
  TDS att_tds;
  LEX_MOC att_scanner;
  DESCRIPTEUR glob_76_desc;
  CLASSE glob_76_c;
  Emplacement glob_76_empl;
  private void regle76() throws Exception {

    //declaration
    T_MOC x_2 = new T_MOC(scanner ) ;
    T_MOC x_3 = new T_MOC(scanner ) ;
    S_SUPER_MOC x_4 = new S_SUPER_MOC(scanner,att_eval) ;
    T_MOC x_5 = new T_MOC(scanner ) ;
    S_ATTRIBUTS_MOC x_7 = new S_ATTRIBUTS_MOC(scanner,att_eval) ;
    T_MOC x_8 = new T_MOC(scanner ) ;
    S_METHODES_MOC x_10 = new S_METHODES_MOC(scanner,att_eval) ;
    T_MOC x_11 = new T_MOC(scanner ) ;
    //appel
if  (att_eval)      action_auto_inh_76(x_3, x_4, x_7, x_10);
    x_2.analyser(LEX_MOC.token_classe);
    x_3.analyser(LEX_MOC.token_identc);
    x_4.analyser() ;
    x_5.analyser(LEX_MOC.token_aco);
if  (att_eval)      action_hattri_76(x_3, x_4, x_7, x_10);
    x_7.analyser() ;
    x_8.analyser(LEX_MOC.token_acf);
if  (att_eval)      action_initM_76(x_3, x_4, x_7, x_10);
    x_10.analyser() ;
    x_11.analyser(LEX_MOC.token_fin);
if  (att_eval)      action_code_76(x_3, x_4, x_7, x_10);
  }
private void action_auto_inh_76(T_MOC x_3, S_SUPER_MOC x_4, S_ATTRIBUTS_MOC x_7, S_METHODES_MOC x_10) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_7.att_tds=this.att_tds;
x_10.att_tds=this.att_tds;
x_7.att_machine=this.att_machine;
x_10.att_machine=this.att_machine;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#auto_inh","IMPLEMENTATION -> classe identc SUPER aco #hattri ATTRIBUTS acf #initM METHODES fin #code ;"});
}
  }
private void action_hattri_76(T_MOC x_3, S_SUPER_MOC x_4, S_ATTRIBUTS_MOC x_7, S_METHODES_MOC x_10) throws Exception {
try {
// locales
TDS loc_mere;
HashMap<String, ATTRIBUTE> loc_att;
// instructions
glob_76_c= new CLASSE(x_3.att_txt, x_4.att_mere);
x_10.att_myclass=x_3.att_txt;
if ((this.att_tds.chercherGlobalementClasse(x_3.att_txt)==null)){
loc_mere=this.att_tds.getParente();
loc_mere.put(x_3.att_txt,  new INFOCLASS(glob_76_c));
this.att_tds.put(x_3.att_txt,  new INFOCLASS(glob_76_c));
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMOCMessages.id_Classe_Definie, MOCMessages.Classe_Definie,new Object[]{""+x_3.att_txt});

}
loc_att= new HashMap<String, ATTRIBUTE>();
if (x_4.att_mere==null){
}
else {
loc_att.putAll(x_4.att_mere.getAttributes());
}
x_7.att_hattributes=loc_att;
if ((x_4.att_mere==null||x_4.att_mere.getTailleAttributes()==0)){
x_7.att_adatt=1;
}
else {
x_7.att_adatt=x_4.att_mere.getTailleAttributes()+1;
}
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#hattri","IMPLEMENTATION -> classe identc SUPER aco #hattri ATTRIBUTS acf #initM METHODES fin #code ;"});
}
  }
private void action_code_76(T_MOC x_3, S_SUPER_MOC x_4, S_ATTRIBUTS_MOC x_7, S_METHODES_MOC x_10) throws Exception {
try {
// locales
TDS loc_mere;
// instructions
this.att_scpt_meth=x_10.att_scpt_meth;
this.att_code=x_10.att_code;
this.att_desc_code=this.att_machine.genDescripteur(glob_76_c.getDesc());
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#code","IMPLEMENTATION -> classe identc SUPER aco #hattri ATTRIBUTS acf #initM METHODES fin #code ;"});
}
  }
private void action_initM_76(T_MOC x_3, S_SUPER_MOC x_4, S_ATTRIBUTS_MOC x_7, S_METHODES_MOC x_10) throws Exception {
try {
// locales
TDS loc_mere;
// instructions
glob_76_empl= new Emplacement(this.att_cpt_desc,  new Register("SB", 0));
glob_76_desc= new DESCRIPTEUR(glob_76_empl);
if (x_4.att_mere!=null){
glob_76_desc.putAll(x_4.att_mere.getDesc());
x_10.att_cpt_meth=x_4.att_mere.getTailleMethodes();
}
else {
x_10.att_cpt_meth=0;
}
glob_76_c.setDesc(glob_76_desc);
glob_76_c.setAttributes(x_7.att_sattributes);
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#initM","IMPLEMENTATION -> classe identc SUPER aco #hattri ATTRIBUTS acf #initM METHODES fin #code ;"});
}
  }
  public void analyser () throws Exception {
    regle76 () ;
  }
  }
